$(document).ready(function(){
	//单个删除
	$(".btndelete").on("click", function() {
	    var $this = $(this);
	    bootbox.confirm("<h3>确定要删除此项?</h3>", "取消", "确定", function(result) {
	        if (result) {
	            $.ajax({
	                url: "/Handler/ProductHandler.ashx",
	                type: "post",
	                dataType: "json",
	                data: {
	                    fun: "f_0006",
	                    id: $this.attr("val")
	                },
	                beforeSend: function () {
	                    //数据加载冻屏
	                    $this.button('loading');
	                },
	                success: function (msg) {
	                    //数据加载完毕解除冻屏
	                    $this.button('reset');
	                    if (msg.r_code == "1") {
	                        toastr.success(msg.r_info,'系统提示：');
	                        //刷新页面
	                        setTimeout(function () {
                                window.location.href = window.location.href;
                            }, 1000);
	                    } else if (msg.r_code == "0") {
	                        toastr.error(msg.r_info,'错误提示：');
	                    }
	                }
	            });
	        }else{
	            $(this).modal("hide");
	        };
	    });
	});
});
